/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package homework;

import java.util.Hashtable;
import java.util.*;

/**
 *
 * @author Administrator
 */
public class BookDemo01 {
   
    public static void main(String args[]){
        try{
            //定义一个容器
            Hashtable h=new Hashtable();
            BookBean temp;
            //在容器中存放五本书的信息，以图书的编号为键
     h.put("isbn001",new BookBean("isbn001","红楼梦"，"曹雪芹"，"人名文学出版社",100));
     h.put("isbn002",new BookBean("isbn002","西游记"，"吴承恩"，"人名文学出版社",100));
     h.put("isbn003",new BookBean("isbn003","水浒传"，"施耐庵"，"人名文学出版社",100));
     h.put("isbn004",new BookBean("isbn004","三国演义"，"罗贯中"，"人名文学出版社",100));
     h.put("isbn005",new BookBean("isbn005","喻世明言"，"冯梦龙"，"人名文学出版社",100));
          //接受要查询的图书编号
         String find "isbn002";
         //判断集合中是否有这个关键字
         if(h.contaninsKey(find)){
             temp=(BookBean)(h.get(find));//根据键的值从集合中取出值对象
             Syatem.out.println("书名":+temp.getName());
             Syatem.out.println("作者":+temp.getAuthor());
             Syatem.out.println("出版社":+temp.getPublisher());
             Syatem.out.println("价格":+temp.getPrice());
         }else{
             System.out.println("查无此书")；
         }
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }

    private static void Hashtable() {
        throw new UnsupportedOperationException("Not yet implemented");
    }

}
